<include file="../Public/manage_top" />

	<style>
	.ui-state-highlight { height: 1.5em; line-height: 1.2em;background-color:#FFEC86}
</style>	
<div class="contents BBS">
  <div class="bbs_left">
 	<include file="../Public/manage_left" />
  </div>
  <div class="bbs_main">
    <div class="top_address">
<span class="edi_adder">
			{$_topnav}
	  </span></div>
      <div class="tit_h3">{:L('base_nav_tclass')}</div>
<form action="{:U('bbs/Manage/dotclass',array('class'=>$board))}" method="post" autocomplete="off">
<input type="hidden" name="type" value="saveCategory">

    <div class="list_box">
      <dl id="sortable">
        <dt>
          <div style="width: 40%;" class="cl">{:L('tclass_name')}</div>
          <div style="width: 50%;" class="cl">{:L('tclass_thread_num')}</div>
          <div style="width: 10%;" class="cc">{:L('operation')}</div>
        </dt>
<volist id="vo" name="list">	 
       <dd id="cate_{$vo.id}"  class="ui-state-disabled">
          <div style="width: 40%;" class="cl">
		  		<input type="text" value="{$vo.name}" class="in_put cl06" style="width: 150px;" name="name[{$vo.id}]"/>
		  </div>
          <div style="width: 50%;" class="cl">{$vo.count}</div>
          <div style="width: 10%;" class="cc"><a href="javascript:void(0)" onclick="deletetclass({$vo.id})">[ {:L('tclass_delete')} ]</a></div>
          <div class="C"></div>
        </dd>
</volist>	
        <dd class="det_l" id="addnewInput">
          <div style="width: 40%;" class="cl"><input type="text" value="" class="in_put cl06" style="width: 150px;" name="newaddname[]"/></div>
          <div style="width: 50%;" class="cl">&nbsp;</div>
          <div style="width: 10%;" class="cc"><a href="javascript:addnew( this )">[ {:L('tclass_add')} ]</a></div>
          <div class="C"></div>
        </dd>
      </dl>
	  <div id="catelist" class="mt10 ml10" ><input type="submit" class="btn_sea"  id="button2" value="{:L('confirm')}" /><font color="red" class="ml10">{:L('tclass_save_info')}</font></div>
    </div>
</form>
  </div><div class="C"></div>
</div>
<script>
	function deletetclass(id){
		if(confirm('{:L("tclass_delete_confirm")}')){
			$.post("{:U('bbs/Manage/dotclass',array('class'=>$board) )}",{type:'deleteCategory',id:id},function(txt){
				txt = eval('('+txt+')');
				if(txt.status){
					$.tbox.yes('{:L("tclass_delete_success")}');
					setTimeout('$.tbox.close()',1500);
					$("#cate_"+id).remove();
				}else{
					$.tbox.no('{:L("tclass_delete_error")}');
					setTimeout('$.tbox.close()',1500);
				}
			});
		}
	}
	function addnew(o){
		$("#catelist").before( '<dd class="det_l">'+$("#addnewInput").html()+'</dd>' );

	}
	
	$(function() {
		$("#sortable").sortable({
			items: '.ui-state-disabled',
			placeholder: 'ui-state-highlight'
		});
	});
	$("#sortable dd").disableSelection();	
</script>	
<script src="__PUBLIC__/js/jquery-ui-1.7.2/sortale.js" language="JavaScript"></script>
<include file="__THEME__/footer" /> 